package me.kuye.jkuye.plugin.activerecord;

import java.io.Serializable;
import java.util.List;

public class Page<T> implements Serializable {
	private List<T> dataList;
	private int totalRecord;
	private int pageCount;
	private int pageSize;
	private int pageNow;

	public Page(int totalRecord, int pageCount, int pageSize, int pageNow, List<T> dataList) {
		this.dataList = dataList;
		this.pageCount = pageCount;
		this.pageSize = pageSize;
		this.pageNow = pageNow;
		this.dataList = dataList;
	}

	public List<T> getDataList() {
		return dataList;
	}

	public int getTotalRecord() {
		return totalRecord;
	}

	public int getPageCount() {
		return pageCount;
	}

	public int getPageSize() {
		return pageSize;
	}

	public int getPageNow() {
		return pageNow;
	}

	public boolean isFirstPage() {
		return pageNow == 1;
	}

	public boolean isLastPage() {
		return pageNow == pageCount;
	}
}
